package com.lianbang.pharmacy.vm

import cn.ubest.mvvmcore.base.BaseListViewModel
import cn.ubest.mvvmcore.interfaces.RequestHandler1Impl
import com.lianbang.pharmacy.bean.CouponListBean
import com.lianbang.pharmacy.model.UserModel

/**
 * Created by maoqi on 2020/12/30.
 */
class CouponVM : BaseListViewModel<UserModel>() {
    override fun loadData(isInit: Boolean, vararg arg: Any) {
        requestWithLife(object : RequestHandler1Impl<List<CouponListBean>>(this) {
            override suspend fun request1(): List<CouponListBean> {
                return mModel.couponList().resolveWrapper()
            }

            override fun onSuccess(t: List<CouponListBean>) {
                setData(t)
            }
        })
    }

}